﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="{$cfg_site_description}" />

<title>商家團購券|個人中心{$cfg_site_name}</title>
{template 'header'}
<body>
<div id="buy917_wrap">
	<div id="buy917_login">
     <div class="logins">
	 {if !empty($_USERS)}
      <ul id="account">
        <li title="tlover" class="username">歡迎您，{$_USERS['uname']}！</li>
        <li class="account1">&nbsp;
		<a href="m.php?action=bond&type=available">我的團購券</a> | <a href="m.php?action=orders&type=all">我的訂單</a> | 
		<a href="m.php?action=account">帳戶餘額</a> | <a href="m.php?action=settings">帳戶設置 | </a>
		</li>
        <li class="logout"><a href="quit.php">退出</a></li>
      </ul>
      {else}
      <ul id="account">
        <li class="login"><a href="login.php">會員登入 | 註冊</a></li>       
      </ul>
      {/if}
      </div>   
	</div>    
    <div id="buy917_header">
    	<div id="buy917_logo"><a href="index.php">Buy917</a></div>
        <div class="buy917_header_banner">
        	<div class="buy917_header_topbanner">
            <?php include("admin/event.php")?>
            </div>
          	<div class="buy917_header_select">
            	<div class="buy917_header_city">
                	 {if !empty($_cityid)}
                    <div class="guides">
                        <div class="city">
                            <h2>{$_cityname}</h2>
                        </div>
                        <div id="guides-city-change" class="change">切換城市</div>
                        <div id="guides-city-list" class="city-list">
                            <ul>
                            {loop $_citylist $v}
                                <li {if $v['cid']==$_cityid}class="current"{/if}><a href="index.php?cityid={$v['cid']}">{$v['cityname']}</a></li>
                            {/loop}
                            </ul>                   
                        </div>
                    </div>
                    {/if}	
                </div>
                <div class="buy917_header_group">
                	{template 'headergroup'}	
                </div>
            </div>
       </div>
    </div><!-- buy917_header -->
  
    <div id="buy917_menu">
    	<a href="index.php">馬上 揪一起</a>
        <a href="grouplist.php">曾經 揪一起</a>
        <a href="article.php?aid=3" <?php if($_GET['aid']== 3){ echo "class='on'";} ?>>怎樣 揪一起</a>
        <a href="article.php?aid=1" class="end <?php if($_GET['aid']== 1){ echo "on";} ?>">問答 揪一起</a>       
    </div><!-- buy917_menu -->
       
    <div id="buy917_middle">
        	<div class="buy917_grouplist_top"></div>      
            <div class="buy917_grouplist_body"> 
               <h2 class="abouth2">
                <ul>
                   <li class="current"><a href="s.php?action=bond">店家管理</a></li>
				   <li><a href="s.php?action=settings">店家設置</a></li>
                </ul>
                </h2>
				
				<div class="box-content">
                <div class="head">
                    <ul class="filter"><li class="label"><b>分類: </b></li><li {if $type=='available'}class="current"{/if}><a href="{$theurl}&type=available">未使用</a></li><li {if $type=='used'}class="current"{/if}><a href="{$theurl}&type=used">已使用</a></li><li {if $type=='expired'}class="current"{/if}><a href="{$theurl}&type=expired">已過期</a></li><li {if $type=='all'}class="current"{/if}><a href="{$theurl}&type=all">所有</a></li></ul>                </div>
					
					
                <div class="sect">
				<form id="search" method="post" action="{$theurl}">
				<input type="hidden" name="type" value="{$type}"/>
				<div class="username">
                    <label for="settings-username">　序列號</label>
                    <input type="text" size="30" name="sn" id="settings-sn" class="f-input" value=""/> <input type="submit" value="查找" name="commit" id="settings-submit" class="formbutton"/><div style="float:right; margin-right:20px; font-weight:bold; font-size:20px"><a id="checkbond" title="驗證團購卷" href="#checkbonddialog" style="font-size:21px;">驗證團購卷</a> </div>     
                </div>
				</form>
                                
                {if empty($value)}     
                   <div class="notice">沒有相關數據</div>
				{else}
				   <table width="98%" cellspacing="0" cellpadding="0" border="0" class="coupons-table" id="order-list">
					<tbody><tr><th>團購項目</th>
					<th>序列號</th>
					<th >過期時間</th>
					<th>使用時間</th>
					<th>狀態</th>
					</tr>
					{loop $value $n $r}
	   				{if $r['gtitle'] !=null}
					<tr {if $n%2==0}class="alt"{/if}>
						<td style="text-align: left;"><a target="_blank" href="view.php?gid={$r['gid']}" class="deal-title">{$r['gtitle']}</a></td>
						<td>{$r['sn']}</td>
						<td>{date("Y-m-d",$r['endtime'])}<br/>{date("H:i",$r['endtime'])}</td>
						<td>{php if(!empty($r['usetime']))echo date("Y-m-d H:i",$r['usetime']);}</td>
						<td class="op">{if $r['state']==2}已使用{elseif $r['endtime']<$timestamp && $r['endtime']!=0}已過期 {elseif $r['state']==3}已預約{else}未使用{/if}</td>
					</tr>
					{/if}
					{/loop}
				</tbody></table>
                 {/if}
              </div>
				<ul class="paginator">
                  {echo pagelist($total,$pagesize,$page,$theurl."&type=$type");}
                </ul>
            </div>
        		
          </div><!-- buy917_grouplist_body -->
          <div class="buy917_grouplist_bottom"></div>
    </div><!-- buy917_middle -->
</div><!-- buy917wrap -->
<!-- footer -->
<div id="buy917_footer">
	{template 'footer'}	
</div>
</body>
</html>
